import pinyin from "pinyin";

console.log(pinyin.pinyin("中心").map(it=>it[0][0]).join('').toUpperCase());    // [ [ 'zhōng' ], [ 'xīn' ] ]